import request from '@/utils/request.js'

export function reqLogin(params) {
  return request({
    url: '/user/login',
    method: 'post',
    headers: {
      ContentType: 'application/x-www-form-urlencoded'
    },
    data: params
  })
}
export function reqLogout() {
  return request({
    url: '/user/logout',
    method: 'post'
  })
}
// get userinfo
export function reqUserinfo() {
  return request({
    url: '/account/userinfo',
    method: 'get'
  })
}
// register user
export function reqRegister(data) {
  return request({
    url: '/user/register',
    method: 'post',
    data
  })
}
// get platform language
export function reqGetlang() {
  return request({
    url: '/user/lang',
    method: 'get'
  })
}
// set platform language
export function reqSetlang(params) {
  return request({
    url: '/user/lang',
    method: 'post',
    headers: {
      ContentType: 'application/x-www-form-urlencoded'
    },
    data: params
  })
}
